IFastString *CallCreateFastString(const char* sz){
    static IFastString * (*pfn)(const char* )=0;
    if(!pfn){
        const TCHAR szDLL[] = _TEXT("faststring.dll");
        const char szFn[] = "CreateFastString";
        HINSTANCE h = LoadLibrary(szDLL);
        if(h)
            *(FARPROC*)&pfn = GetProcAddress(h,szFn);
    }

    return pfn ? pfn(sz) : 0;
}



//to save a string to disk
bool SaveString(IFastString* pfs,const char* pszFn)
{
    bool result=false;
    IPersistentObject* ppo = dynamic_cast<IPersistentObject*>(pfs);
    if(ppo)
        result = ppo->Save(pszFn);
    return result;
}

void f(){
    IFastString* f=0;
    IPersistentObject* ppo=0;

    f = CreateFastString("Feed me");
    if(f)
    {
        ppo = (IPersistentObject*)f->Dynamic_Cast("IPersistentObject");
        if(ppo)
        {
            ppo->Sava("/usr/local/");
            ppo->DestoryPointer();
        }
        f->DestoryPointer();
    }
}
